<?php 
	include ("../../config/koneksi.php");
	$q = "select * from agama";
	$r = mysql_query($q);
	
	$content = "NO;AGAMA\n";
	while ($data = mysql_fetch_array($r)) {
		$no++;
		$content .= "$no;$data[agama];\n";
	};

	header("Content-type: text/csv");
	header("Content-Disposition: attachment; filename=agama.csv");
	header("Pragma: no-cache");
	header("Expires: 0");
	echo $content;
?>